
FOR EACH pt_mstr WHERE index("M510,M520,M530",pt_part_type)> 0  NO-LOCK:

    FOR EACH ptp_det WHERE ptp_part = pt_part EXCLUSIVE-LOCK:

        IF ptp__chr01 = "C" AND ptp_site = SUBSTR(pt_part_type,2,3)  THEN
           ASSIGN ptp__chr01 = "".

        IF ptp_site = "500" THEN DO:

           ASSIGN ptp__chr01 = "C".

           IF ptp_pm_code <> "D" THEN
              ptp_pm_code = "D".
        END.
    END.
    
/*     FIND FIRST ptp_det WHERE ptp_part = pt_part AND ptp_site = "500" NO-ERROR.                      */
/*     IF AVAILABLE ptp_det THEN                                                                       */
/*     IF ptp_site = "500" AND ptp__chr01 = "" THEN                                                    */
/*        DISP pt_part_type pt_part ptp_pm_code ptp_site ptp__chr01 pt_desc1 WITH STREAM-IO WIDTH 200. */


    
END.
